<?php
namespace app\admin\model;

use think\Model;
use think\Db;

class JsonModel extends Model
{
	/**
	*  将数组转为json
	* @param int $code
	* @param string $msg
	* @param string $data
	* @param string $url
	* @param string $url
	*/
	public function returnJson($code = 0, $msg='',$data = '', $url = '')
	{
		return json(['code' => $code,'msg' => $msg, 'data' => $data, 'url' => $url]);                                                                                                                                         
		exit;
	} 

	public function get_client_ip($type = 0, $adv = false)
	{
	    return request()->ip($type, $adv);
	}

}